#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMenu>


MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setWindowFlags(Qt::CustomizeWindowHint |Qt::WindowCloseButtonHint);
    connect(ui->tvMess,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(ShowMenu(QPoint)));
}

void MainWindow::ShowMenu(QPoint point){
    QMenu contextMenu(tr("Context menu"), this);
    QAction actAdd("Add", this);
     QAction actRemove("Remove", this);

    //connect(&action1, SIGNAL(triggered()), this, SLOT(removeDataPoint()));
    contextMenu.addAction(&actAdd);
    contextMenu.addAction(&actRemove);
    contextMenu.exec(this->mapToGlobal(point));
}

MainWindow::~MainWindow()
{
    delete ui;
}
